package fl.ass.service.service.impl;

import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.comm.facade.framework.api.ISysRegionApiService;
import cmm.comm.facade.framework.condition.SysRegionQueryCondition;
import cmm.comm.facade.framework.dto.SysDictionaryDTO;
import cmm.comm.facade.framework.dto.SysRegionDTO;
import cmm.comm.facade.upload.constant.SysUlFilesRecConstant;
import cmm.service.core.framework.biz.BaseBizImpl;
import cmm.service.core.framework.dao.IBaseDao;
import cmm.user.facade.system.api.ISysOrgApiService;
import cmm.user.facade.system.api.ISysUsrApiService;
import cmm.user.facade.system.dto.SysOrgDTO;
import cmm.user.facade.system.dto.SysUsrDTO;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.constant.BaseExceptionConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.logger.eum.LogExceptionEnum;
import cn.cmm.base.framework.utils.*;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.capital.condition.CapFundQueryCondition;
import cn.fl.capital.condition.CapPayInfoQueryCondition;
import cn.fl.capital.constant.CapAdvFundConstant;
import cn.fl.capital.constant.CapPayInfoConstant;
import cn.fl.capital.constant.CapitalConstant;
import cn.fl.capital.dto.CapFundDTO;
import cn.fl.capital.dto.CapPayInfoDTO;
import cn.fl.capital.service.ICapFundApiService;
import cn.fl.capital.service.ICapPayInfoApiService;
import cn.fl.project.api.IPrjPaySchMYqApiService;
import cn.fl.project.api.IProjectModifyApiService;
import cn.fl.project.condition.PrjPaySchMYqQC;
import cn.fl.project.condition.PrjPrdDtlQueryCondition;
import cn.fl.project.condition.PrjPrdDtlSchRQC;
import cn.fl.project.constant.PrjPrdDtlConstant;
import cn.fl.project.dto.PrjPaySchMYqDTO;
import cn.fl.project.dto.PrjPrdDtlDTO;
import cn.fl.project.dto.PrjPrdDtlSchRDTO;
import cn.fl.project.service.IPrjPrdPaySchMApiService;
import cn.fl.project.service.IProjectApiService;
import cn.lb.framework.poi.excel.ExcelExportUtil;
import cn.lb.framework.poi.excel.entity.ExportParams;
import cn.lb.framework.poi.excel.entity.enmus.ExcelType;
import com.alibaba.fastjson.JSON;
import fl.ass.facade.condition.AssDealCarQueryCondition;
import fl.ass.facade.condition.AssTrailCarDQueryCondition;
import fl.ass.facade.condition.AssTrailCarHvQueryCondition;
import fl.ass.facade.condition.AssTrailCarMQueryCondition;
import fl.ass.facade.constant.AssFileConstant;
import fl.ass.facade.constant.InterfaceConstants;
import fl.ass.facade.dto.AssTrailCarDDTO;
import fl.ass.facade.dto.AssTrailCarHvDTO;
import fl.ass.facade.dto.AssTrailCarMDTO;
import fl.ass.facade.dto.ProductStatusLogDTO;
import fl.ass.service.config.NacosConfiguration;
import fl.ass.service.dao.AssDealCarMapper;
import fl.ass.service.dao.AssTrailCarDMapper;
import fl.ass.service.dao.AssTrailCarHvMapper;
import fl.ass.service.dao.AssTrailCarMMapper;
import fl.ass.service.po.AssDealCar;
import fl.ass.service.po.AssTrailCarD;
import fl.ass.service.po.AssTrailCarM;
import fl.ass.service.service.IAssTrailCarDService;
import fl.ass.service.service.IAssTrailCarMService;
import fl.ass.service.transform.AssTrailCarMTransform;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Workbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description: 拖车信息主表 服务层接口实现
 * @Description: 类中已经实现了简单增删改查操作,可以直接使用,如果有需要重写该方法即可：
 * @Description: 1、add(TVO entity) 2、removeById(Long id) 3、modify(DTO entity) 4、selectById(Long id)	5、searchListPage(Pager page) 7、searchList(DTO dto)
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
@Service
public class AssTrailCarMServiceImpl extends BaseBizImpl<AssTrailCarM, AssTrailCarMDTO, AssTrailCarMQueryCondition> implements IAssTrailCarMService {

	private static final Logger logger = LoggerFactory.getLogger(IAssTrailCarMService.class);

	@Autowired
	private AssTrailCarMMapper assTrailCarMMapper;

	@Autowired
	private AssTrailCarDMapper assTrailCarDMapper;

	@Autowired
	private AssDealCarMapper assDealCarMapper;
	@Autowired
	private AssTrailCarHvMapper assTrailCarHvMapper;
	@Autowired
	private ISysDictionaryApiService sysDictionaryApiService;

	@Autowired
	private ISysOrgApiService sysOrgApiService;//组织架构 API 暴露服务

	@Autowired
	private ISysUsrApiService sysUsrApiService;//系统用户API 暴露服务

    @Autowired
    private ISysRegionApiService sysRegionApiService;

    @Autowired
    private IPrjPaySchMYqApiService prjPaySchMYqApiService;

    @Autowired
    private IProjectApiService projectApiService;

    @Autowired
    private ICapPayInfoApiService capPayInfoApiService;

    @Autowired
    private ICapFundApiService capFundApiService;

    /**
     * 支付表主表服务
     */
    @Autowired
    private IPrjPrdPaySchMApiService prjPrdPaySchMApiService;

    @Autowired
    private NacosConfiguration nacosConfiguration;

	@Override
	public List<AssTrailCarMDTO> searchList(AssTrailCarMQueryCondition condition) throws BaseException {
		if(null == condition) return new ArrayList<AssTrailCarMDTO>();
		List<AssTrailCarM> list = this.assTrailCarMMapper.selectList(condition);
		return AssTrailCarMTransform.toDTOList(list);
	}

	@Override
	public IBaseDao<AssTrailCarM,AssTrailCarMQueryCondition> getDao() {
		return this.assTrailCarMMapper;
	}

	/**
	 * 导出拖车模块信息
	 * @param
	 * @param orgCd
	 * @return
	 * @throws BaseException
	 */
	@Override
	public String exportAssInfo(AssTrailCarDQueryCondition condition1, AssDealCarQueryCondition condition2, AssTrailCarHvQueryCondition condition3,String orgCd, String eFlag) throws BaseException {
        Long start = System.currentTimeMillis();
	    // 定义一个打印时间对象
		if(null==condition1 && null==condition2){
			//throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "查询条件不能为空.");
		}
		if(StringUtils.isEmpty(orgCd)){
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "组织架构代码不能为空");
		}
		if(StringUtils.isEmpty(eFlag)){
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "导出文件标识不能为空");
		}
		List<AssDealCar> ycgl_list =  new ArrayList<AssDealCar>();//优车管理列表
		List<AssTrailCarD> tcsq_list = new ArrayList<AssTrailCarD>();//拖车申请列表
		List<AssTrailCarDDTO> tcgl_list = new ArrayList<AssTrailCarDDTO>();//拖车管理列表
		List<AssTrailCarHvDTO> kggl_list =  new ArrayList<AssTrailCarHvDTO>();//库管管理列表
		if(eFlag.equals("tcsq")){
			//拖车申请列表
			tcsq_list = this.assTrailCarDMapper.selectTrailCarApplyList(condition1);
			tcsq_list = this.dealTcApplyStatus(tcsq_list);
			BaseLogUtils.newLogger("导出拖车申请查询结果列表").info();
		}else if(eFlag.equals("tcgl")){
			//拖车管理列表
			tcgl_list = this.assTrailCarDMapper.selectTrailCarList(condition1);
			tcgl_list = this.dealTcManageStatus(tcgl_list);
            BaseLogUtils.newLogger("导出拖车管理查询结果列表").info();
		}else if(eFlag.equals("ycgl")){
			//优车管理列表
			ycgl_list = this.assDealCarMapper.findAssDealCarList(condition2);
			ycgl_list = this.dealYcManageStatus(ycgl_list);
            BaseLogUtils.newLogger("导出优车管理查询结果列表").info();
		}else if(eFlag.equals("kggl")){
			//库管管理列表
			kggl_list = this.assTrailCarHvMapper.findAssTrailCarHvList(condition3);
			kggl_list = dealSomething(kggl_list);
            BaseLogUtils.newLogger("导出库管管理查询结果列表").info();
		}
		//判断查询结果是否为空
		if(CollectionUtils.isEmpty(ycgl_list) && CollectionUtils.isEmpty(tcgl_list) && CollectionUtils.isEmpty(kggl_list) && CollectionUtils.isEmpty(tcsq_list)){
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "没有符合要求的拖车模块信息.");
		}
		String path = this.exportAssInfoToExcel(tcgl_list, ycgl_list, kggl_list, tcsq_list, orgCd, eFlag);
        Long end = System.currentTimeMillis();
        BaseLogUtils.newLogger("导出拖车模块信息,需要的总耗时").setKeys((end - start) + "ms").info();
		return path;
	}

    @Override
    public List<AssTrailCarMDTO> selectListByChnIds(AssTrailCarMQueryCondition condition) throws BaseException {
        if(null == condition) return new ArrayList<AssTrailCarMDTO>();
        List<AssTrailCarM> list = this.assTrailCarMMapper.selectListByChnIds(condition);
        return AssTrailCarMTransform.toDTOList(list);
    }

    /**
	 * 处理拖车申请导出列表数据
	 * @param tcsq_list
	 * @return
	 */
	private List<AssTrailCarD> dealTcApplyStatus(List<AssTrailCarD> tcsq_list) {
		Double money = new Double(0);
		SysDictionaryDTO dictionary = null;
		if(null != tcsq_list && tcsq_list.size()>0){
			for(AssTrailCarD po : tcsq_list){
				//获取事业部名称-JL-20181105
				if(StringUtils.isNotBlank(po.getBuOrgCd())){
					po.setOrgName(this.getOrgName(po.getBuOrgCd()));
				}

				//处理拖车状态
				if(StringUtils.isNotBlank(po.getBackStsCd())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.BACK_STATUS_CD, po.getBackStsCd());
					if(null != dictionary){
						po.setBackStsCd(dictionary.getCodeNm());
					}else{
						po.setBackStsCd("未申请");
					}
				}else{
					po.setBackStsCd("未申请");
				}
				//处理支付表状态
				if(StringUtils.isNotBlank(po.getPayStatus())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.PAY_STATUS_CD, po.getPayStatus());
					if(null != dictionary){
						po.setPayStatus(dictionary.getCodeNm());
					}
				}
				//处理业务类型
				if(StringUtils.isNotBlank(po.getBusinessType())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.BUSINESS_TYPE_CD, po.getBusinessType());
					if(null != dictionary){
						po.setBusinessType(dictionary.getCodeNm());
					}
				}
				//处理事业部-得到事业部名称
				if(StringUtils.isNotBlank(po.getBuOrgCd())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.BUSINESS_ORG_CD, po.getBuOrgCd());
					if(null != dictionary){
						po.setBuOrgCd(dictionary.getCodeDesc());
					}
				}
				//处理逾期租金
				if(StringUtils.isNotEmpty(po.getOverdueAmt())){
					money = DecimalUtils.convertFenToYuan(po.getOverdueAmt());
					po.setOverdueAmt2(money);
				}
				//处理罚息金额
				if(StringUtils.isNotEmpty(po.getPenaltyAmt())){
					money = DecimalUtils.convertFenToYuan(po.getPenaltyAmt());
					po.setPenaltyAmt2(money);
				}
				//处理应付款总金额
				if(StringUtils.isNotEmpty(po.getPayAmt())){
					money = DecimalUtils.convertFenToYuan(po.getPayAmt());
					po.setPayAmt2(money);
				}
				//处理保底价款
				if(StringUtils.isNotEmpty(po.getBaseAmt())){
					money = DecimalUtils.convertFenToYuan(po.getBaseAmt());
					po.setBaseAmt2(money);
				}
				//处理实付金额
				if(StringUtils.isNotEmpty(po.getActualAmt())){
					money = DecimalUtils.convertFenToYuan(po.getActualAmt());
					po.setActualAmt2(money);
				}
			}
		}
		return tcsq_list;
	}

	/**
	 * 处理拖车管理导出列表数据
	 * @param tcgl_list
	 * @return
	 */
	private List<AssTrailCarDDTO> dealTcManageStatus(List<AssTrailCarDDTO> tcgl_list) {
		Double money = new Double(0);
		// SysDictionaryDTO dictionary = null;
		List<SysDictionaryDTO> backStatusList = this.sysDictionaryApiService.searchGroup(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.BACK_STATUS_CD);
		List<SysDictionaryDTO> dealStatusList = this.sysDictionaryApiService.searchGroup(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.DEAL_STATUS_CD);
		if(null != tcgl_list && tcgl_list.size()>0){
			for(AssTrailCarDDTO dto : tcgl_list){
				//处理拖车状态
				if(StringUtils.isNotBlank(dto.getBackStsCd())){
					for (SysDictionaryDTO backSts : backStatusList) {
                        if (dto.getBackStsCd().equals(backSts.getCode())) {
                            dto.setBackStsCd(backSts.getCodeNm());
                            break;
                        }
                    }
				}else{
					dto.setBackStsCd("未申请");
				}
				//处理处置状态
				if(StringUtils.isNotBlank(dto.getDealStsCd())){
                    for (SysDictionaryDTO dealSts : dealStatusList) {
                        if (dto.getDealStsCd().equals(dealSts.getCode())) {
                            dto.setDealStsCd(dealSts.getCodeNm());
                            break;
                        }
                    }
				}else{
					dto.setDealStsCd("未处置");
				}
				//处理逾期租金
				if(StringUtils.isNotEmpty(dto.getOverdueAmt())){
					money = DecimalUtils.convertFenToYuan(dto.getOverdueAmt());
					dto.setOverdueAmt2(money);
				}
				//处理罚息金额
				if(StringUtils.isNotEmpty(dto.getPenaltyAmt())){
					money = DecimalUtils.convertFenToYuan(dto.getPenaltyAmt());
					dto.setPenaltyAmt2(money);
				}
				//处理应付款总金额
				if(StringUtils.isNotEmpty(dto.getPayAmt())){
					money = DecimalUtils.convertFenToYuan(dto.getPayAmt());
					dto.setPayAmt2(money);
				}
				//处理预计拖车费用
				if(StringUtils.isNotEmpty(dto.getBackAmt())){
					money = DecimalUtils.convertFenToYuan(dto.getBackAmt());
					dto.setBackAmt2(money);
				}
				//处理实际拖车费用
				if(StringUtils.isNotEmpty(dto.getActBackAmt())){
					money = DecimalUtils.convertFenToYuan(dto.getActBackAmt());
					dto.setActBackAmt2(money);
				}
				//处理保底价款
				if(StringUtils.isNotEmpty(dto.getBaseAmt())){
					money = DecimalUtils.convertFenToYuan(dto.getBaseAmt());
					dto.setBaseAmt2(money);
				}
				//处理拖回时间
				if(null != dto.getActBackDt()){
					dto.setActBackDt2(DateUtils.formatDateToString(dto.getActBackDt(), DateUtils.YYYY_MM_DD));
				}
			}
		}
		return tcgl_list;
	}

	/**
	 * 处理优车管理导出列表数据
	 * @param ycgl_list
	 * @return
	 */
	private List<AssDealCar> dealYcManageStatus(List<AssDealCar> ycgl_list) {
		Double money = new Double(0);
		String dateStr = "";
		SysDictionaryDTO dictionary = null;
		if(null != ycgl_list && ycgl_list.size()>0){
			for(AssDealCar po : ycgl_list){
				//处理拖车状态
				if(StringUtils.isNotBlank(po.getBackStsCd())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.BACK_STATUS_CD, po.getBackStsCd());
					if(null != dictionary){
						po.setBackStsCd(dictionary.getCodeNm());
					}else{
						po.setBackStsCd("未申请");
					}
				}else{
					po.setBackStsCd("未申请");
				}
				//处理处置状态
				if(StringUtils.isNotBlank(po.getDealStsCd())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.DEAL_STATUS_CD, po.getDealStsCd());
					if(null != dictionary){
						po.setDealStsCd(dictionary.getCodeNm());
					}else{
						po.setDealStsCd("未处置");
					}
				}else{
					po.setDealStsCd("未处置");
				}
				//处理评估状态
				if(StringUtils.isNotBlank(po.getEvalStatusCd())){
					dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.EVAL_STATUS_CD, po.getEvalStatusCd());
					if(null != dictionary){
						po.setEvalStatusCd(dictionary.getCodeNm());
					}
				}
				//处理入库时间
				if(StringUtils.isNotEmpty(po.getIsEnter()) && po.getIsEnter()==1){
					dateStr = DateUtils.formatDateToString(po.getEnterTm(), DateUtils.YYYY_MM_DD);
				}else{
					dateStr = "未入库";
				}
				po.setEnterTm2(dateStr);
				//处理出库时间
				if(StringUtils.isNotEmpty(po.getIsOut()) && po.getIsOut()==1){
					dateStr = DateUtils.formatDateToString(po.getOutTm(), DateUtils.YYYY_MM_DD);
				}else{
					dateStr = "未出库";
				}
				po.setOutTm2(dateStr);
				//处理处置费用
				if(StringUtils.isNotEmpty(po.getDealAmt())){
					money = DecimalUtils.convertFenToYuan(po.getDealAmt());
					po.setDealAmt2(money);
				}
			}
		}
		return ycgl_list;
	}

	/**
	 * 处理库管导出列表数据
	 * @param kggl_list
	 * @return
	 */
	private List<AssTrailCarHvDTO> dealSomething(List<AssTrailCarHvDTO> kggl_list) {
		SysDictionaryDTO dictionary = null;
		Long dealAmt = null;
		Long zero = new Long(0);
		for(AssTrailCarHvDTO dto : kggl_list){
			//入库时间处理
			if(null!=dto.getEnterTm()){
				dto.setEnterTmString(DateUtils.formatDateToString(dto.getEnterTm(), DateUtils.YYYY_MM_DD));
			}
			//出库时间处理
			if(null!=dto.getOutTm()){
				dto.setOutTmString(DateUtils.formatDateToString(dto.getOutTm(), DateUtils.YYYY_MM_DD));
			}
			//处理拖车状态
			if(StringUtils.isNotBlank(dto.getBackStsCd())){
				dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.BACK_STATUS_CD, dto.getBackStsCd());
				if(null != dictionary){
					dto.setBackStsCd(dictionary.getCodeNm());
				}
			}
			//处理处置状态
			if(StringUtils.isNotBlank(dto.getDealStsCd())){
				dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.DEAL_STATUS_CD, dto.getDealStsCd());
				if(null != dictionary){
					dto.setDealStsCd(dictionary.getCodeNm());
				}
			}
			//处理评价状态
			if(StringUtils.isNotBlank(dto.getEvalStatusCd())){
				dictionary = sysDictionaryApiService.getCode(InterfaceConstants.SYS_CODE, InterfaceConstants.ORG_CODE, InterfaceConstants.EVAL_STATUS_CD, dto.getEvalStatusCd());
				if(null != dictionary){
					dto.setEvalStatusCd(dictionary.getCodeNm());
				}
			}
			//处理处置金额
			dealAmt = dto.getDealAmt();
			if(null == dealAmt){
				dealAmt = dto.getSellAmt();
				if(null != dealAmt && dealAmt.compareTo(zero) > 0){
					dto.setDealAmt(dealAmt);
				}else{
					dto.setDealAmt(zero);
				}
			}else{
				if(dealAmt.compareTo(zero) < 1){
					dto.setDealAmt(zero);
				}
			}
		}
		return kggl_list;
	}

	/**
	 * 导出拖车模块信息
	 * @param
	 * @return
	 */
	private String exportAssInfoToExcel(List<AssTrailCarDDTO> exportList1, List<AssDealCar> exportList2, List<AssTrailCarHvDTO> exportList3, List<AssTrailCarD> exportList4, String orgCd, String eFlag)throws BaseException{
		ExportParams params = new ExportParams(null, null,ExcelType.XSSF);
		params.setTitleHeight((short) 5);
        params.setColor(HSSFColor.LIGHT_TURQUOISE.index);//表头颜色
        params.setHeaderColor(HSSFColor.WHITE.index);//间隔颜色-未启用
        params.setStyle(ExcelExportStylerColorImpl.class);
		Workbook workbook = null;

		String titleInfo = "";
		if(StringUtils.isEmpty(eFlag)){
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "导出文件标识不能为空");
		}else if(eFlag.equals("tcsq") && CollectionUtils.isNotEmpty(exportList4)){
			//拖车申请列表
			titleInfo = "拖车申请列表";
			workbook = ExcelExportUtil.exportExcel(params, AssTrailCarD.class, exportList4);
		}else if(eFlag.equals("tcgl") && CollectionUtils.isNotEmpty(exportList1)){
			//拖车管理列表
			titleInfo = "拖车管理列表";
			workbook = ExcelExportUtil.exportExcel(params, AssTrailCarDDTO.class, exportList1);
		}else if(eFlag.equals("ycgl") && CollectionUtils.isNotEmpty(exportList2)){
			//优车管理列表
			titleInfo = "优车管理列表";
			workbook = ExcelExportUtil.exportExcel(params, AssDealCar.class, exportList2);
		}else if(eFlag.equals("kggl") && CollectionUtils.isNotEmpty(exportList3)){
			//库管管理列表
			titleInfo = "库管管理列表";
			workbook = ExcelExportUtil.exportExcel(params, AssTrailCarHvDTO.class, exportList3);
		}

		String filePath = AssFileConstant.SYS_EXPORT_PARK_SAVE_DIR;
		String serverFilePath = this.getServerFilePath(filePath);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String filename = titleInfo + sdf.format(new Date());
		serverFilePath = serverFilePath + filename + ".xlsx";
		FileOutputStream fos = null;
		try {
			fos=new FileOutputStream(serverFilePath);
			workbook.write(fos);
			fos.flush();
		} catch (FileNotFoundException e) {
			BaseLogUtils.newLogger("文件找不到").setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_700,e.getMessage());
		} catch (Exception e) {
            BaseLogUtils.newLogger("写入excel异常").setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_700, BaseExceptionConstant.BASE_EXCEPTION_CODE_700_NAME);
		}finally {
			try {
				if(null!=fos){
					fos.close();
				}
			} catch (IOException e) {
				BaseLogUtils.newLogger("导出拖车模块信息失败").setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
				throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_700, BaseExceptionConstant.BASE_EXCEPTION_CODE_700_NAME);
			}
		}
		BaseLogUtils.newLogger("导出拖车模块信息,文件根路径.").setKeys("serverFilePath:" + serverFilePath).info();
//		String serverPath = serverFilePath.replace(PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.SYS_FILE_UPLOAD_ROOT_PATH), PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.SYS_FILE_UPLOAD_SERVER_PATH));
        String serverPath = serverFilePath.replace(nacosConfiguration.getUlfilesRootPath(), nacosConfiguration.getUlfilesServerPath());
		return serverPath;
	}

	/**
	 * 创建文件服务器保存路径
	 */
	private String getServerFilePath(String filePath)throws BaseException{
//		String prifixPath = PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.SYS_FILE_UPLOAD_ROOT_PATH);//根目录
        String prifixPath = nacosConfiguration.getUlfilesRootPath();//根目录
		StringBuffer savePath = new StringBuffer(prifixPath);//最终保存路径
		if(!savePath.toString().endsWith(SysUlFilesRecConstant.SYS_FILE_PATH_SLASH)){//判断是否以"/"结尾,不是加入斜杠
    		savePath.append(SysUlFilesRecConstant.SYS_FILE_PATH_SLASH);
    	}
//		savePath.append(PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.UPLOAD_COSTOMER_PATH));//自定义代码-其中包括系统代码
        savePath.append(nacosConfiguration.getUlfilesCustomerPath());//自定义代码-其中包括系统代码
		if(StringUtils.isNotEmpty(filePath)){//如果不等于空则加入
			if(filePath.startsWith(SysUlFilesRecConstant.SYS_FILE_PATH_SLASH)){//判断是否以"/"开头
				savePath.append(filePath.substring(1));
			}else{
				savePath.append(filePath);
			}

		}
		if(!savePath.toString().endsWith(SysUlFilesRecConstant.SYS_FILE_PATH_SLASH)){//判断是否以"/"结尾
    		savePath.append(SysUlFilesRecConstant.SYS_FILE_PATH_SLASH);
    	}
		String currentTime = DateUtils.formatDateToString(new Date(), DateUtils.YYYYMMDD);
		savePath.append(currentTime);
		savePath.append(SysUlFilesRecConstant.SYS_FILE_PATH_SLASH);
	    //检查目录
		File pathFile = new File(savePath.toString());
	    if (!pathFile.exists()) {
	    	//文件夹不存 创建文件
	    	boolean createPath = pathFile.mkdirs();
	    	if(!createPath){
	    		BaseLogUtils.newLogger("创建文件保存服务器路径失败").setKeys("savePath:" + savePath).info();
	    		throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "服务器附件目录未创建成功!");
	    	}
	    }
	    BaseLogUtils.newLogger("获取文件保存服务器路径").setKeys("savePath:" + savePath).info();
	    return savePath.toString();
	}

	/**
	 * 时间：2018-11-05
	 * 开发者：JL
	 * 功能：根据orgCd获取事业部名称
	 */
	public String getOrgName(String str1){
		String orgName = "";
		//获取所有事业部（组织架构类型（SYS0006）值为“2”）
		List<SysOrgDTO> sysOrgDTOList = sysOrgApiService.searchListByOrgTypCd("2", "11000");
		//获取事业部名称
		if(sysOrgDTOList != null && sysOrgDTOList.size() >0){
			for(SysOrgDTO org : sysOrgDTOList){
				String str2 = org.getOrgCd();
				if(StringUtils.isNotBlank(str2) && str1.equals(str2)){
					orgName = org.getOrgNm();
				}
			}
		}
		return orgName;
	}

	/**
	 * 时间：2018-11-08
	 * 开发者：JL
	 * 功能：重写 selectById方法，获取资管员信息
	 */
	@Override
	public AssTrailCarMDTO selectById(Long id) throws BaseException {
		AssTrailCarM po = this.assTrailCarMMapper.selectById(id);
		if(null != po){
			//获取用户
			if(StringUtils.isNotEmpty(po.getManageId())){
				SysUsrDTO usr = this.sysUsrApiService.selectSysUsrById(po.getManageId(),"11000","0000");
				String assManagers = usr.getRefRlNm()+"["+usr.getUsrNm()+"]";
				po.setAssManagers(assManagers);
			}
			/*
              获取省市信息开始
             */
            StringBuffer provinceCity = new StringBuffer();
            SysRegionQueryCondition qc = new SysRegionQueryCondition();
            qc.setSysCd("11000");
            qc.setRgnLvl(1);
            qc.setRgnCd(po.getProvinceCd());
            List<SysRegionDTO> sysRegionProvince = this.sysRegionApiService.searchRegionList(qc);
            if (CollectionUtils.isNotEmpty(sysRegionProvince)) {
                provinceCity.append(sysRegionProvince.get(0).getRgnNm() + "-");
            }
            qc.setRgnLvl(2);
            qc.setRgnCd(po.getCityCd());
            List<SysRegionDTO> sysRegionCity = this.sysRegionApiService.searchRegionList(qc);
            if (CollectionUtils.isNotEmpty(sysRegionCity)) {
                provinceCity.append(sysRegionCity.get(0).getRgnNm());
            }
            po.setProvinceCity(provinceCity.toString());
            /*
              获取省市信息结束
             */
		}
		return AssTrailCarMTransform.toDTO(po);
	}

    @Override
    public List<Long> searchPrjPrdPaySchIdsByPrjPrdDtlId(Long prjPrdDtlId) throws BaseException {
        return this.assTrailCarMMapper.searchPrjPrdPaySchIdsByPrjPrdDtlId(prjPrdDtlId);
    }

    @Override
    public void updateYQPrdStsCdByFlow(ProductStatusLogDTO productStatusLogDTO) throws BaseException {
        BaseLogUtils.newLogger("updateYQPrdStsCdByFlow参数").setKeys("productStatusLogDTO" + JSON.toJSONString(productStatusLogDTO)).info();
        try {
            if (StringUtils.isEmpty(productStatusLogDTO.getPrjPrdId())) {
                throw new BaseException("产品明细id不能为空");
            }
            PrjPrdDtlSchRQC prjPrdDtlSchRQC = new PrjPrdDtlSchRQC();
            prjPrdDtlSchRQC.setPrjPrdDtlId(productStatusLogDTO.getPrjPrdId());
            List<PrjPrdDtlSchRDTO> prjPrdDtlSchRDTOS = this.prjPrdPaySchMApiService.searchDtlSchRList(prjPrdDtlSchRQC);
            List<Long> paySchIds = new ArrayList<>(prjPrdDtlSchRDTOS.size());
            for (PrjPrdDtlSchRDTO prjPrdDtlSchRDTO : prjPrdDtlSchRDTOS) {
                paySchIds.add(prjPrdDtlSchRDTO.getPaySchId());
            }
            PrjPaySchMYqQC prjPaySchMYqQC = new PrjPaySchMYqQC();
            prjPaySchMYqQC.setPaySchIds(paySchIds);
            // 查询全部疫情支付表数据
            List<PrjPaySchMYqDTO> prjPaySchMYqVOS = this.prjPaySchMYqApiService.searchList(prjPaySchMYqQC);
            BaseLogUtils.newLogger("疫情数据").setKeys("prjPaySchMYqVOS" + JSON.toJSONString(prjPaySchMYqVOS)).info();
            if (CollectionUtils.isNotEmpty(prjPaySchMYqVOS)) {
                List<Long> yqPaySchIds = new ArrayList<>(prjPaySchMYqVOS.size());
                for (PrjPaySchMYqDTO prjPaySchMYqDTO : prjPaySchMYqVOS) {
                    if (StringUtils.isEmpty(prjPaySchMYqDTO.getYqPaySchId())) {
                        continue;
                    }
                    yqPaySchIds.add(prjPaySchMYqDTO.getYqPaySchId());
                }
                if (CollectionUtils.isEmpty(yqPaySchIds)) {
                    return;
                }
                List<String> payStsCdList = new ArrayList<>(2);
                payStsCdList.add(CapPayInfoConstant.CODE_PAY_STS_CD_FIN);
                payStsCdList.add(CapPayInfoConstant.CODE_PAY_STS_CD_5);
                CapPayInfoQueryCondition capPayInfoQueryCondition = new CapPayInfoQueryCondition();
                capPayInfoQueryCondition.setPaySchIdList(yqPaySchIds);
                capPayInfoQueryCondition.setPayStsCdList(payStsCdList);
                capPayInfoQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
                capPayInfoQueryCondition.setIsValid(BaseConstant.IS_YESNO_YES);
                // 放款信息（已放款&已完成）
                List<CapPayInfoDTO> capPayInfoDTOS = this.capPayInfoApiService.searchCapPayInfoList(capPayInfoQueryCondition);
                BaseLogUtils.newLogger("放款数据").setKeys("capPayInfoDTOS" + JSON.toJSONString(capPayInfoDTOS)).info();
                if (CollectionUtils.isNotEmpty(capPayInfoDTOS)) {
                    List<ProductStatusLogDTO> dtos = new ArrayList<>();
                    for (CapPayInfoDTO capPayInfoDTO : capPayInfoDTOS) {
                        ProductStatusLogDTO psld = new ProductStatusLogDTO();
                        BeanUtils.copyProperties(productStatusLogDTO, psld);
                        psld.setPaySchId(capPayInfoDTO.getPaySchId());
                        psld.setPrjPrdId(capPayInfoDTO.getPrjPrdDtlId());
                        dtos.add(psld);
                    }
                    List<AssTrailCarDDTO> payListByIds = this.assTrailCarDMapper.findPayListByIds(dtos);
                    BaseLogUtils.newLogger("前置状态数据").setKeys("payListByIds" + JSON.toJSONString(payListByIds)).info();
                    for (AssTrailCarDDTO payListById : payListByIds) {
                        for (ProductStatusLogDTO dto : dtos) {
                            if (StringUtils.isNotEmpty(payListById.getPrjPrdDtlId()) && payListById.getPrjPrdDtlId().equals(dto.getPrjPrdId())) {
                                // 获取前置状态
                                dto.setPreStatus(payListById.getPayStatus());
                            }
                        }
                    }
                    BaseLogUtils.newLogger("修改支付表状态前").setKeys("dtos" + JSON.toJSONString(dtos)).info();
                    List<ProductStatusLogDTO> addedDTOs = new ArrayList<>();
                    for (ProductStatusLogDTO dto : dtos) {
                        if ((InterfaceConstants.PAY_STATUS_CD_S01060201.equals(dto.getPreStatus()) && InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getCurrentStatus()))
                                || ((InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) || InterfaceConstants.PAY_STATUS_CD_S01060203.equals(dto.getPreStatus())) && InterfaceConstants.PAY_STATUS_CD_S0106020301.equals(dto.getCurrentStatus()))
                                || ((InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) || InterfaceConstants.PAY_STATUS_CD_S0106020301.equals(dto.getPreStatus())) && InterfaceConstants.PAY_STATUS_CD_S010602030101.equals(dto.getCurrentStatus()))
                                || ((InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) || InterfaceConstants.PAY_STATUS_CD_S010602030101.equals(dto.getPreStatus())) && InterfaceConstants.PAY_STATUS_CD_S0106020301.equals(dto.getCurrentStatus()))
                                || (InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) && InterfaceConstants.PAY_STATUS_CD_S01060201.equals(dto.getCurrentStatus()))
                                || (InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) && InterfaceConstants.PAY_STATUS_CD_S01060203.equals(dto.getCurrentStatus()))) {
                            AssTrailCarDDTO assTrailCarDDTO = new AssTrailCarDDTO();
                            assTrailCarDDTO.setPayStatus(dto.getCurrentStatus());
                            assTrailCarDDTO.setOpCode(dto.getOpCode());
                            assTrailCarDDTO.setMdfUsrId(dto.getCrtUsrId());
                            assTrailCarDDTO.setMdfTm(new Date());
                            assTrailCarDDTO.setPrjPrdDtlId(dto.getPrjPrdId());
                            assTrailCarDMapper.updatePayStatus(assTrailCarDDTO);
                            addedDTOs.add(dto);
                        }
                        if (((InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) || InterfaceConstants.PAY_STATUS_CD_S01060201.equals(dto.getPreStatus())) && InterfaceConstants.PAY_STATUS_CD_S0106020101.equals(dto.getCurrentStatus()))
                                || ((InterfaceConstants.PAY_STATUS_CD_S01.equals(dto.getPreStatus()) || InterfaceConstants.PAY_STATUS_CD_S010602030101.equals(dto.getPreStatus())) && InterfaceConstants.PAY_STATUS_CD_S01060203010101.equals(dto.getCurrentStatus()))) {
                            AssTrailCarDDTO assTrailCarDDTO = new AssTrailCarDDTO();
                            assTrailCarDDTO.setPayStatus(dto.getCurrentStatus());
                            assTrailCarDDTO.setOpCode(dto.getOpCode());
                            assTrailCarDDTO.setMdfUsrId(dto.getCrtUsrId());
                            assTrailCarDDTO.setMdfTm(new Date());
                            assTrailCarDDTO.setPrjPrdDtlId(dto.getPrjPrdId());
                            assTrailCarDDTO.setSettleDate(new Date());
                            assTrailCarDMapper.updatePayStatusBySettle(assTrailCarDDTO);
                            addedDTOs.add(dto);
                        }
                    }
                    if (CollectionUtils.isNotEmpty(addedDTOs)) {
                        // 添加支付表状态变更记录
                        this.assTrailCarDMapper.batchAddPrdStatusLog(addedDTOs);
                    }
                }
            }
        } catch (BaseException e) {
            BaseLogUtils.newLogger("同步YQ支付表状态失败").setKeys("productStatusLogDTO:" + JSON.toJSONString(productStatusLogDTO)).setThrowable(e).setWarning(false).error(LogExceptionEnum.COMMON_CODE_0002);
            throw e;
        } catch (Exception e) {
            BaseLogUtils.newLogger("同步YQ支付表状态失败").setKeys("productStatusLogDTO:" + JSON.toJSONString(productStatusLogDTO)).setThrowable(e).setWarning(false).error(LogExceptionEnum.COMMON_CODE_0002);
            throw e;
        }
    }

    @Override
    public boolean checkRestFund4YQ(Long prjPrdDtlId, Long cstId) throws BaseException {
	    try {
            if (StringUtils.isEmpty(prjPrdDtlId)) {
                throw new BaseException("产品明细id不能为空");
            }
            boolean check = true;
            PrjPrdDtlSchRQC prjPrdDtlSchRQC = new PrjPrdDtlSchRQC();
            prjPrdDtlSchRQC.setPrjPrdDtlId(prjPrdDtlId);
            List<PrjPrdDtlSchRDTO> prjPrdDtlSchRDTOS = this.prjPrdPaySchMApiService.searchDtlSchRList(prjPrdDtlSchRQC);
            List<Long> paySchIds = new ArrayList<>(prjPrdDtlSchRDTOS.size());
            for (PrjPrdDtlSchRDTO prjPrdDtlSchRDTO : prjPrdDtlSchRDTOS) {
                paySchIds.add(prjPrdDtlSchRDTO.getPaySchId());
            }
            PrjPaySchMYqQC prjPaySchMYqQC = new PrjPaySchMYqQC();
            prjPaySchMYqQC.setPaySchIds(paySchIds);
            // 查询全部疫情支付表数据
            List<PrjPaySchMYqDTO> prjPaySchMYqDTOS = this.prjPaySchMYqApiService.searchList(prjPaySchMYqQC);
            if (CollectionUtils.isNotEmpty(prjPaySchMYqDTOS)) {
                PrjPrdDtlQueryCondition qc = new PrjPrdDtlQueryCondition();
                List<Long> yqPaySchIds = new ArrayList<>(prjPaySchMYqDTOS.size());
                List<String> prdStsCdList = new ArrayList<>(1);
                qc.setPrdStsCdList(prdStsCdList);
                prjPaySchMYqDTOS.stream().forEach(prjPaySchMYqDTO -> {
                    if (StringUtils.isEmpty(prjPaySchMYqDTO.getYqPaySchId())) {
                        return;
                    }
                    yqPaySchIds.add(prjPaySchMYqDTO.getYqPaySchId());
                });
                if (CollectionUtils.isEmpty(yqPaySchIds)) {
                    return check;
                }
                qc.setPaySchIdList(yqPaySchIds);
                // 查关联疫情支付表是否有正常的数据
                List<PrjPrdDtlDTO> prjPrdDtlDTOS = projectApiService.selectPrjPrdDtlList(qc);
                if (CollectionUtils.isNotEmpty(prjPrdDtlDTOS)) {
                    for (PrjPrdDtlDTO prjPrdDtlDTO : prjPrdDtlDTOS) {
                        // 非已正常结清、非已提前结清、非已强制结清
                        if (!PrjPrdDtlConstant.CODE_PRJ_PRD_STS_CD_03.equals(prjPrdDtlDTO.getPrdStsCd()) &&
                                !PrjPrdDtlConstant.CODE_PRJ_PRD_STS_CD_05.equals(prjPrdDtlDTO.getPrdStsCd()) &&
                                !PrjPrdDtlConstant.CODE_PRJ_PRD_STS_CD_40.equals(prjPrdDtlDTO.getPrdStsCd())) {
                            CapFundQueryCondition capFundQueryCondition = new CapFundQueryCondition();
                            List<String> fundStsCd = new ArrayList<>(2);
                            fundStsCd.add(CapitalConstant.CODE_CAP_FUND_STS_CD_0);
                            fundStsCd.add(CapitalConstant.CODE_CAP_FUND_STS_CD_1);
                            capFundQueryCondition.setRelationPayIdList(paySchIds);
                            capFundQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
                            capFundQueryCondition.setFundStatusCdList(fundStsCd);
                            capFundQueryCondition.setCstId(cstId);
                            capFundQueryCondition.setFundPid(0L);
                            // 关联的资金数据
                            List<CapFundDTO> capFundDTOS = this.capFundApiService.searchCapFundList(capFundQueryCondition);
                            if (CollectionUtils.isNotEmpty(capFundDTOS)) {
                                Long avaliableAmt = 0L;
                                for (CapFundDTO capFundDTO : capFundDTOS) {
                                    avaliableAmt += capFundDTO.getAvailableAmount();
                                }
                                // 剩余可用资金不为0
                                if (0L != avaliableAmt) {
                                    check = false;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            return check;
        } catch (BaseException e) {
	        BaseLogUtils.newLogger("校验是否有剩余资金异常").setKeys("prjPrdDtlId:" + prjPrdDtlId).setThrowable(e).setWarning(false).error(LogExceptionEnum.COMMON_CODE_0002);
            throw e;
        } catch (Exception e) {
            BaseLogUtils.newLogger("校验是否有剩余资金异常").setKeys("prjPrdDtlId:" + prjPrdDtlId).setThrowable(e).setWarning(false).error(LogExceptionEnum.COMMON_CODE_0002);
	        throw e;
        }
    }

    @Override
    public boolean checkDealOrTransUsedFlowStart(Long assMainId) throws BaseException {
	    try {
            boolean check = true;
            AssTrailCarDQueryCondition assTrailCarDQueryCondition = new AssTrailCarDQueryCondition();
            assTrailCarDQueryCondition.setMasterId(assMainId);
            assTrailCarDQueryCondition.setIsDel(InterfaceConstants.IS_DEL_0);
            assTrailCarDQueryCondition.setIsHis(InterfaceConstants.IS_HIS_0);
            List<AssTrailCarD> assTrailCarDS = this.assTrailCarDMapper.selectList(assTrailCarDQueryCondition);
            if (CollectionUtils.isEmpty(assTrailCarDS)) {
                throw new BaseException("未查到拖车明细信息");
            }
            // 车贷支付表id
            Long prjPrdDtlId = assTrailCarDS.get(0).getPrjPrdDtlId();
            PrjPrdDtlSchRQC prjPrdDtlSchRQC = new PrjPrdDtlSchRQC();
            prjPrdDtlSchRQC.setPrjPrdDtlId(Long.valueOf(prjPrdDtlId));
            List<PrjPrdDtlSchRDTO> prjPrdDtlSchRDTOS = this.prjPrdPaySchMApiService.searchDtlSchRList(prjPrdDtlSchRQC);
            List<Long> paySchIds = new ArrayList<>(prjPrdDtlSchRDTOS.size());
            for (PrjPrdDtlSchRDTO prjPrdDtlSchRDTO : prjPrdDtlSchRDTOS) {
                paySchIds.add(prjPrdDtlSchRDTO.getPaySchId());
            }
            PrjPaySchMYqQC prjPaySchMYqQC = new PrjPaySchMYqQC();
            prjPaySchMYqQC.setPaySchIds(paySchIds);
            // 关联的疫情贷数据
            List<PrjPaySchMYqDTO> prjPaySchMYqDTOS = this.prjPaySchMYqApiService.searchList(prjPaySchMYqQC);
            if (CollectionUtils.isNotEmpty(prjPaySchMYqDTOS)) {
                List<Long> yqPaySchIds = new ArrayList<>(prjPaySchMYqDTOS.size());
                for (PrjPaySchMYqDTO prjPaySchMYqDTO : prjPaySchMYqDTOS) {
                    if (StringUtils.isEmpty(prjPaySchMYqDTO.getYqPaySchId())) {
                        return false;
                    }
                    yqPaySchIds.add(prjPaySchMYqDTO.getYqPaySchId());
                }
                List<String> payStsCdList = new ArrayList<>(2);
                payStsCdList.add(CapPayInfoConstant.CODE_PAY_STS_CD_N_START);
                CapPayInfoQueryCondition capPayInfoQueryCondition = new CapPayInfoQueryCondition();
                capPayInfoQueryCondition.setPaySchIdList(yqPaySchIds);
                capPayInfoQueryCondition.setPayStsCdList(payStsCdList);
                capPayInfoQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
                capPayInfoQueryCondition.setIsValid(BaseConstant.IS_YESNO_YES);
                // 放款信息（未申请）
                List<CapPayInfoDTO> capPayInfoDTOS = this.capPayInfoApiService.searchCapPayInfoList(capPayInfoQueryCondition);
                if (CollectionUtils.isNotEmpty(capPayInfoDTOS)) {
                    check = false;
                }
            }
            return check;
        } catch (BaseException e) {
            BaseLogUtils.newLogger("校验是否应该发起处置或转优车流程失败").setKeys("assMainId：" + assMainId).setThrowable(e).setWarning(false).error(LogExceptionEnum.COMMON_CODE_0002);
            throw e;
        } catch (Exception e) {
	        BaseLogUtils.newLogger("校验是否应该发起处置或转优车流程失败").setKeys("assMainId：" + assMainId).setThrowable(e).setWarning(false).error(LogExceptionEnum.COMMON_CODE_0002);
            throw e;
        }
    }

}

